<?php

namespace app\cps\validate;

use think\Validate;
use app\common\Error;

class CustomRechargeTemplate extends Validate
{
    protected $rule = [
        'id' => 'require',
        'name' => 'require',
        'video_id' => 'require',
        'type' => 'require',
        'sort' => 'require',
        'pay_amount' => 'require',
        'link_ids' => 'require',
        'custom_recharge_id' => 'require',
    ];

    protected $message = [
        'id.require' => Error::ID_NOT_EXIXTS,
        'video_id.require' => Error::VIDEO_ID_SELECT_NOT_EXIXTS,
        'name.require' => Error::TEMPLATE_NAME_NOT_EXIXTS,
        'sort.require' => Error::RECHARGE_SORT_NOT_EXIXTS,
        'type.require' => Error::PLEASE_SELECT_TYPE,
        'pay_amount.require' => Error::PLEASE_WRITE_PAY_AMOUNT,
        'link_ids.require' => Error::PLEASE_SELECT_UPDATE_LINK,
        'custom_recharge_id.require' => Error::PLEASE_SELECT_VIDEO_PAY_SETTING,
    ];

    protected $scene = [
        'add' => ['video_id', 'name', 'type', 'sort', 'pay_amount'],
        'edit' => ['id', 'video_id', 'name', 'type', 'sort', 'pay_amount'],
        'delete' => ['id'],
        'batch_recharge_setting' => ['link_ids', 'custom_recharge_id'],
    ];
}